﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TekaMUD.Engine.Blocks;
using TekaMUD.Engine.Framework;
using TekaMUD.Engine.IO;

namespace TekaMUD.Engine
{
	/// <summary>
	/// Static methods to handle NPC movement
	/// </summary>
	[Obsolete("Consider removing this class and place the code in the IaEngine class")]
	public class NpcMover
	{
		public static bool GenericMovement(NPC agent, RoomConnection targetConnection)
		{
			Room startRoom;
			Room endRoom;

			startRoom = agent.CurrentRoom;

				endRoom = targetConnection.End;

				if (endRoom == null)
				{
					return false;
				}

				
				Logger.LogDebug("Moving agent " + agent.Name + " from: " + startRoom + " to: " + endRoom);

				World.Current.AssignNpcToRoom(agent, endRoom);

				Messenger.SendRoom(startRoom, "The " + agent.Name + " leaves " + targetConnection.Direction.ToString() + ".\r\n");
				Messenger.SendRoom(endRoom, agent.Article + " " + agent.Name + " enters the room.\r\n");

				return true;

		}
	}
}
